package com.example.mall.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.mall.domain.entity.Product;
import com.example.mall.mapper.ProductMapper;
import com.example.mall.service.ProductService;
import com.example.mall.domain.vo.ProductVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements ProductService {

    @Resource
    private ProductMapper productMapper;

    @Override
    public Page<ProductVO> pageListProduct(String name,String categoryId,Integer page, Integer size) {
        IPage<ProductVO> page1 = new Page<>(page, size);
        return productMapper.selectPageProductList(name,categoryId,page1);
    }
}